package cn.wolfcode.car.business.service;

import cn.wolfcode.car.business.domain.BpmnInfo;
import cn.wolfcode.car.business.query.BpmnInfoQuery;
import cn.wolfcode.car.common.base.page.TablePageInfo;
import org.springframework.web.multipart.MultipartFile;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;

/**
 * activiti信息接口
 */
public interface IBpmnInfoService {

    /**
     * 分页
     * @param qo
     * @return
     */
    TablePageInfo<BpmnInfo> query(BpmnInfoQuery qo);



    /**
     * 查询全部
     * @return
     */
    List<BpmnInfo> list();

    /**
     * 文件上传操作
     * @param file
     * @return
     */
    String uploading(MultipartFile file) throws IOException;

    /**
     * 部署bpmn文件到actviti
     * @param path
     * @param bpmnType
     * @param info
     * @throws FileNotFoundException
     */
    void deploy(String path, String bpmnType, String info) throws FileNotFoundException;

    /**
     * 读取文件返回出去
     * @param deploymentId
     * @param type
     * @return
     */
    InputStream readResource(String deploymentId, String type);

    /**
     * 删除功能
     * @param id
     */
    void delete(Long id);

    /**
     * 根据类型查询流程定义
     * @param car_package
     * @return
     */
    List<BpmnInfo> queryByBpmnType(String car_package);
}
